<?php
if(!defined('IN_DISCUZ')){exit('Access Denied');} 

$petconfigtxt="";
$mysettings = $db->query_first("SELECT * FROM {$tablepre}wxpetconfig WHERE 1 limit 0,1");
$petconfigtxt.="<?php";
$petconfigtxt.="\n//WuxinPet SystemConfig  cache file, DO NOT modify me!";
$petconfigtxt.="\n\$petsettings = Array(";

foreach($mysettings as $colname => $values) {
	if(in_array($colname,array('version','opentime','openday','petgm','notice'))){
		$petconfigtxt.="\n\t'".$colname."' => '".$values."',";
	}else{
		$petconfigtxt.="\n\t'".$colname."' => ".$values.",";
	}
}

$petconfigtxt=substr($petconfigtxt,0,strlen($petconfigtxt)-1);
$petconfigtxt.="\n\t);";

$petconfigtxt.="\n?>";
@$fp = fopen(DISCUZ_ROOT.'./petshop/system/petconfig.php','w');
@flock($fp, 2);
@fwrite($fp, $petconfigtxt);
@fclose($fp);
?>